package com.canal.admin.util;

import com.canal.admin.entity.SysUser;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author yangbo
 * @Date 2019-04-04 10:40
 */
public class SecurityUtils {

    private SecurityUtils() {}

    public static SysUser currentUser() {
        SysUser user = (SysUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user;
    }
}
